<!DOCTYPE html>
<html lang="en"><head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>珀莱雅红宝石精华2.0A醇精华液50ml</title>
    <style>
        @font-face {
          font-family: "iconfont"; /* Project id 1933990 */
          src: url('http://at.alicdn.com/t/font_1933990_onkm2v35lt.woff2?t=1632621338799') format('woff2'),
               url('http://at.alicdn.com/t/font_1933990_onkm2v35lt.woff?t=1632621338799') format('woff'),
               url('http://at.alicdn.com/t/font_1933990_onkm2v35lt.ttf?t=1632621338799') format('truetype');
        }
        
        .iconfont {
          font-family: "iconfont" !important;
          font-size: 16px;
          font-style: normal;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
        
        .icon-close1:before {
          content: "\e6a7";
        }
      /* 内容样式 */
      body{
        background: #eee;
      }
      *{
          margin: 0;
          padding: 0;
      }
      .container {
        width: 100%;
        height: auto;
        max-width: 600px;
        margin:auto;
      }
      .top-title{
        background: linear-gradient(
    20deg, rgb(255,69,60), rgb(255,91,51));
        color: #FFFFFF;
        width: 100%;
        max-width: 600px;
        height: 45px;
        line-height:45px;
        font-size: 1.0rem;
        /*position: fixed;*/
        /*top: 0;*/
        /*left: 0;*/
        /*z-index: 111;*/
      }
      .title-text{
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        /*line-height: 50px;*/
        text-align: center;
        box-sizing: border-box;
        padding: 0 20px;
      }
      .content {
        width: 100%;
        box-sizing: border-box;
        /*padding: 15px;*/
        min-height: 50vh;
        /*margin-top: 40px;*/
      }
      .list{
          /*display: flex;*/
          flex-direction: column;
          align-items: center;
          /*width: 100%;*/
          /*margin-bottom: 20px;*/
          text-align: center;
          margin:14px;
          margin-top:16px;
      }
      .img{
        width: 100%;
        border-radius: 0.625rem;
        box-shadow:0px 0.25rem 0.5rem rgb(70 70 70 / 30%);
        margin-bottom: 0.5rem;
        border: 0.125rem solid #e4e7ea;
      }
      .text{
        color: #808080;
        font-size: 12px;
        /*margin: 8px 20px;*/
      }
      .list-content{
        width: 100%;
        /*margin: 14px;*/
        margin-top: 16px;
        background-color: white;
        padding: 0.5rem 0px;
        border-radius: 5px;
        /* font-weight: 600; */
        font-size: 0.8rem;
        border: 1px dashed #fb6a65;
        /*margin-top: 0;*/
      }
      .foo{
          /*text-align: left;*/
      }
      .b1{
        font-size: 2vw;
        margin: 0 1.5px;
      }
      .b2{
        display: inline-block;
        font-size: 2vw;
        width: 4vw;
        height: 4vw;
        background: #fd1064;
        color: #fff;
        text-align: center;
        line-height: 4vw;
        border-radius: 4vw;
        margin-right: 3px;
      }
      .btn{
        width: 100%;
        display: flex;
        /*flex-direction: column;*/
        text-align: center;
        padding: 0px;
        margin-top:16px;
      }
      .btn-link{
        font-size: 14px;
        background: #20a8d8;
        text-decoration: none;
        margin: auto;
        padding: 10px 0px;
        color: white;
        border-radius: 6px;
        width: 90vw;
      }
      .btn-link:hover{
          background:#31b9e9;
      }
      .cope{
        font-size: 15px;
        background: linear-gradient(
    20deg, rgb(255,69,60), rgb(255,91,51));
        margin: auto;
        padding: 10px 0px;
        color: white;
        /* height: 40px; */
        /* line-height: 40px; */
        border-radius: 6px;
        width: 100%;
        margin-bottom: 2px;
        cursor:pointer;
      }
      .cope:hover{
          background:#FFA500;
      }
      .bottom-wrap{
          width: 100%;
          /*margin-top: 10px;*/
      }
      .bottom-img{
          width: 100%;
          display: block;
      }
      .bottom-content{
          width: 100%;
          height: 100vh;
      }
      .bottom-content::-webkit-scrollbar{
          width: 10px; /*对垂直流动条有效*/ 
          height: 10px; /*对水平流动条有效*/ 
      }
      .dialong{
            display: block;
            z-index: 999;
            position: fixed;
            top: 0;
            left: 0;
            text-align: center;
            width: 100vw;
            height: 100vh;
            background-color: rgba(0,0,0,0.8);
        }
        .dialong>.demo2-img-click{
            width: 90%;
            max-width:600px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
        }
        .wz{
            margin: 20px 10px 10px 10px;
            background-color: #f0f0f0;
            padding: 10px;
            line-height: 2rem;
            border-radius: 16px;
            /* font-weight: 600; */
            font-size: 0.8rem;
            text-align: center;
        }
        .ac_img_box{
            position: absolute;
            width: 75%;
            max-width: 400px;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
        }
        .ac_img{
            width: 100%;
            display: block;
        }
        .icon-close1{
            font-size: 35px;
            display: block;
            margin: 0 auto;
            color: #fff;
            margin-top: 15px;
        }
        [v-cloak]{
            display:none;
        }
        
        .copy-tip{
            display:flex;
            justify-content: space-around;
            align-items:center;
            background:linear-gradient(to right, #f9c492, #fb6a65);
            color:white;
            font-size:12px;
            height:24px;
        }
        
        .jtone{
            position:relative;
            width:0;
            height:0;
            border-top:12px solid transparent;
            border-left:10px solid white;
            border-bottom:12px solid transparent;
        }
        .jtone::before{
            content:"";
            position:absolute;
            top:-12px;
            left:-13px;
            width: 0;
            height:0;
            border-top:12px solid transparent;
            border-left: 10px solid #fab189;
            border-bottom:  12px solid transparent;
        }
        .jttwo{
            position:relative;
            width:0;
            height:0;
            border-top:12px solid transparent;
            border-left:10px solid white;
            border-bottom:12px solid transparent;
        }
        .jttwo::before{
            content:"";
            position:absolute;
            top:-12px;
            left:-13px;
            width: 0;
            height:0;
            border-top:12px solid transparent;
            border-left: 10px solid #fa9b7e;
            border-bottom:  12px solid transparent;
        }
        .jtthree{
            position:relative;
            width:0;
            height:0;
            border-top:12px solid transparent;
            border-left:10px solid white;
            border-bottom:12px solid transparent;
        }
        .jtthree::before{
            content:"";
            position:absolute;
            top:-12px;
            left:-13px;
            width: 0;
            height:0;
            border-top:12px solid transparent;
            border-left: 10px solid #fa8673;
            border-bottom:  12px solid transparent;
        }
        img{
            max-width:100%;
            vertical-align: middle;
            box-sizing: border-box;
        }
        .list-button-1{
            animation: img 0.8s ease-in-out infinite;
        }
        @keyframes img{
            0%{
                transform:scale(1);
            }
            50%{
                transform:scale(1.05);
            }
            100%{
                transform:scale(1);
            }
        }
    </style>
  <link rel="stylesheet" href="/js/theme/default/layer.css?v=3.1.1" id="layuicss-layer"></head>
  <body>
    <div id="app" class="container"><div class="top-title"><div class="title-text">珀莱雅红宝石精华2.0A醇精华液50ml</div></div> <div class="content"><div class="list"><div><img src="https://img.alicdn.com/imgextra/i1/4026955029/O1CN01O7UQZ11n1KdIuLnDg_!!4026955029.jpg" class="img"> <div class="text">(点击图片放大查看)</div></div> <div class="list-content"><!----> <!----> <span id="foo0" class="foo">￥Gre4dREHKuf￥</span></div> <div style="width: 100%;"><div class="btn"><div data-clipboard-target="#foo0" class="cope list-button0"><p>一键复制</p></div></div> <div id="copy-tip" class="copy-tip"><span>长按框内</span> <span class="jtone"></span> <span>全选</span> <span class="jttwo"></span> <span>复制</span> <span class="jtthree"></span> <span><img src="https://pic.kuaizhan.com/g3/ba/35/9ec3-520f-471d-834b-6410aa24ef0315" style="width: 18px;">打开手机Tao宝</span></div></div> <!----></div></div> <div class="bottom-wrap"><img src="http://eco.haipibang.cn/1608932782810.png" class="bottom-img"> <!----></div> <!----> <!----></div>
    <!--<script src="https://libs.cdnjs.net/jquery/3.5.1/jquery.min.js"></script>-->
    <!--<script src="https://libs.cdnjs.net/layer/3.1.1/layer.min.js"></script>-->
    <!--<script src="https://libs.cdnjs.net/clipboard.js/2.0.6/clipboard.min.js"></script>-->
    <!--<script src="https://libs.cdnjs.net/vue/2.6.9/vue.min.js"></script>-->
    <!--<script src="https://libs.cdnjs.net/axios/0.21.1/axios.min.js"></script>-->
    <script src="/js/jquery.min.js"></script>
    <script src="/js/layer.min.js"></script>
    <script src="/js/clipboard.js"></script>
    <script src="/js/vue.min.js"></script>
    <script src="/js/axios.js"></script>
    <script>
      let vm = new Vue({
        el: "#app",
        data: {
          test: "hello",
          list:[],
          obj:{},
          info:{},
          img_src:'',
          img_dialog: false,
          title:'',
          pop_flag:false,
          ios: false,
          arr: [],
        },
        methods: {
            btn_check(index){
                res = "一键复制"
                if(this.ios&&!this.arr.includes(index)&&!this.obj.sn){
                    res = "点击自动前往【淘宝】领券"
                }
                return res
            },
            check_ios(){
                var res = false;
                var ua = navigator.userAgent.toLowerCase();
                if(ua.indexOf("ios") > -1 || ua.indexOf("mac") > -1 || ua.indexOf("iphone") > -1 || ua.indexOf("ipad") > -1){
                    res = true
                }
                this.ios = res;
            },
            // 获取中间页数据
            get_data(password = ''){
                console.log(layer)
                let loading = layer.msg('加载中...',{
                    icon:16,
                    shade:0.3,
                    time:false
                })
               axios.get(`/api_v3/middle.php?sn=${this.obj.sn}&type=get_page_detail&password=${password}`).then(res => {
                   if(res.data.code == 1){
                       layer.close(loading)
                        if(res.data.pass_require == 1){
                            let password = localStorage.getItem('middle_password:'+this.obj.sn)
                            if(password != null){
                                this.get_data(password)
                            }else{
                                window.location.href = './pass.html?pattern=1&'+window.location.href.split('?')[1]
                            }
                        }else{
                            let arr = res.data.data
                           arr.forEach(item => {
                                // item.content_check == 'true'?item.content_check=true:item.content_check=false
                                // item.encode_mode == 'true'?item.encode_mode=true:item.encode_mode=false
                                this.list.push(item)
                            });
                            document.title = decodeURI(res.data.title)
                            this.title = res.data.title
                        }
                   }
               })
            },
            
            // 获取随机字符串
            get_code(){
                let str = '0123456789abcdefghijklmnopqrstuvwxyyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
                let res = ''
                for(let i=0;i<9;i++){
                    let index = parseInt(Math.random()*(str.length-1))
                    res += str[index]
                }
                return '￥'+res+'￥'
            },
            
            // 复制按钮点击
            copy_tkl(index){
                let that = this
                let clipboard = new ClipboardJS('.list-button'+index, {
                    text:function(){
                        var e = $("#foo"+index)[0].innerText.replace(/\n\n/g, "\n")
                        var list = e.match(/[￥|$|#|《|》|€|£|₳|(|)|₤|₵|₪|¥|\/][0-9a-zA-Z]{11}[￥|$|#|《|》|€|£|₳|)|(|₤|₵|₪|¥]/g)
                        if(list != null){
                            list.forEach(item => {
                                e = e.replace(item, item + "/ MF3135 ")
                                if(!that.arr.includes(index) && that.ios){
                                    axios.get(`/api_v3/middle.php?type=tburl&tkl=${item}`).then(res => {
                                        res = res.data;
                                        if(res.code == 1 && that.ios && that.info.ios_click == 1){
                                            window.location.href = res.data;
                                        }
                                    })
                                    that.arr.push(index)
                                    if(that.info.ios_click == 1){
                                        e = " ";
                                    }
                                }
                            })
                        }
                        console.log(e)
                        return e;
                    }
                })
                clipboard.on('success', function(e) {
                    layer.msg('复制成功,请打开[淘宝app]查看');
                    console.log('复制成功')
                    e.clearSelection();
                    clipboard.destroy();
                    if(index == -1){
                        setTimeout(() => {
                            that.pop_flag = false
                        },1000)
                    }
                });
                
                clipboard.on('error', function(e) {
                    layer.msg('复制失败，请手动复制~');
                    clipboard.destroy();
                });
                if(index != -1){
                    this.copy_num(this.list[index].number)
                }
            },
            
            // 获取url参数
            get_params(){
                var url = window.location.href
                var params = url.split('?')[1]
                var arr = params.split('&')
                if(url.indexOf("&") == -1){
                    arr = decodeURIComponent(params).split('#')
                }
                var obj = {}
                arr.forEach(val => {
                    var content = val.split('=')
                    obj[content[0]] = content[1]
                })
                this.obj = obj
            },
            
            // 复制量统计
            copy_num(num){
                axios.get(`/api_v3/middle.php?type=copy_count&sn=${this.obj.sn}&number=${num}`).then(res => {
                    if(res.data.code == 1){
                        // this.info = res.data.data
                        // console.log(this.info)
                        // this.pop_flag = this.info.activity_switch
                    }
                })
            },
            
            // 中间页全局配置信息获取
            get_info(){
                axios.get(`/api_v3/middle.php?sn=${this.obj.sn}&type=get_page_options`).then(res => {
                    if(res.data.code == 1){
                        this.info = res.data.data
                        console.log(this.info)
                        this.pop_flag = this.info.activity_switch
                        
                        frame_init()
                    }
                })
            },
            
            get_info_api(){
                axios.get(`/api_v3/middle.php?apikey=${this.obj.apikey}&type=get_page_options`).then(res => {
                    if(res.data.code == 1){
                        this.info = res.data.data
                        this.pop_flag = this.info.activity_switch
                        
                        frame_init()
                    }
                })
            },
            
            // 跳转到bottom_url
            nav_bottom_url(){
                if(this.info.bottom_url != ""){
                    window.location.href = this.info.bottom_url
                }
            },
            
            // 跳转到iframe_url
            nav_iframe(){
                if(this.info.framework_url != ""){
                    window.location.href = this.info.framework_url
                }
            },
            
            // 点击图片放大
            clickImg(src){
                this.img_src = src;
                this.img_dialog = true;
            },
        },
        created() {
            this.check_ios();
            this.get_params()
            // if(!this.obj.apikey){
            //     return;
            // }
            if(this.obj.sn){
                this.get_data()
                this.get_info()
            }else{
                document.title = decodeURI(this.obj.title)
                this.title = decodeURI(this.obj.title)
                if(this.obj.taowords != undefined){
                    this.obj.tkl = this.obj.taowords
                }
                let obj = {
                    button: "0",
                    number: "0",
                    pic: decodeURIComponent(this.obj.pic),
                    apikey: this.obj.apikey,
                    title: this.obj.title,
                    tkl: decodeURIComponent(this.obj.tkl),
                    tkl_check: "true",
                    video_mode: "0",
                    encode_mode: 0,
                    content: decodeURIComponent(this.obj.tkl),
                }
                if(this.obj.image != undefined){
                    obj.pic = this.obj.image
                }
                this.list = [obj]
                this.get_info_api()
            }
        }
      });
      
      function frame_init(){
          console.log("init")
          setTimeout(() => {
              var IframeOnClick = {
        		 resolution: 200,
        		 iframes: [],
        		 interval: null,
        		 Iframe: function() {
        		  this.element = arguments[0];
        		  this.cb = arguments[1]; 
        		
        		  this.hasTracked = false;
        		 },
        		 track: function(element, cb) {
        		  this.iframes.push(new this.Iframe(element, cb));
        		  if (!this.interval) {
        		   var _this = this;
        		   this.interval = setInterval(function() { _this.checkClick(); }, this.resolution);
        		  }
        		 },
        		
        		 checkClick: function() {
        		  if (document.activeElement) {
        		   var activeElement = document.activeElement;
        		   for (var i in this.iframes) {
        		    if (activeElement === this.iframes[i].element) {
        		     if (this.iframes[i].hasTracked == false) { 
        		      this.iframes[i].cb.apply(window, []); 
        		
        		      this.iframes[i].hasTracked = true;
        		     }
        		    } else {
        		     this.iframes[i].hasTracked = false;
        		    }
        		   }
        		  }
        		 }
        		};
        		IframeOnClick.track(document.getElementById("iframe1"), function(){window.location=vm.info.framework_url})
          }, 500)
      }
    </script><div class="layui-layer-move"></div>
  

</body></html>